package com.zzf.guigu.Thread;

/**
 * @Author ZZF
 * @Date 2021-08-25-17:35
 */
public class ThreadTest1 {
    public static void main(String[] args) {
        new Thread("线程一") {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    if (i % 2 == 0) {
                        System.out.println(Thread.currentThread().getName() + ":" + i);
                    }
                }
            }
        }.start();

        new Thread("线程2"){
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    if (i % 2 != 0){
                        System.out.println(Thread.currentThread().getName() + ":" + i);
                    }
                }
            }
        }.start();
    }
}
